package ffmvc.model;

import java.sql.ResultSet;
import java.sql.SQLException;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;

public class AggPerformanceExtractor implements ResultSetExtractor<AggPerformance> {
	@Override
	public AggPerformance extractData(ResultSet rs) throws SQLException, DataAccessException {
		AggPerformance perf = new AggPerformance();
		perf.setPlayerId(rs.getString(1));
		perf.setSeason(rs.getString(2));
		perf.setPoints(rs.getDouble(3));
		perf.setAssists(rs.getDouble(4));
		perf.setGoalsAllowed(rs.getDouble(5));
		perf.setFoulsWon(rs.getDouble(6));
		perf.setYellowCards(rs.getDouble(7));
		perf.setPenaltyKickGoals(rs.getDouble(8));
		perf.setFoulsCommitted(rs.getDouble(9));
		perf.setMatchWinningGoals(rs.getDouble(10));
		perf.setBlockedShots(rs.getDouble(11));
		perf.setPenaltyKickSaves(rs.getDouble(12));
		perf.setTacklesWon(rs.getDouble(13));
		perf.setGive(rs.getDouble(14));
		perf.setPenaltiescommitted(rs.getDouble(15));
		perf.setShotsOnTarget(rs.getDouble(16));
		perf.setRedCards(rs.getDouble(17));
		perf.setPassesIntercepted(rs.getDouble(18));
		perf.setPenaltyKickMisses(rs.getDouble(19));
		perf.setGoals(rs.getDouble(20));
		perf.setGamePlayed(rs.getDouble(21));
		perf.setDefeat(rs.getDouble(22));
		perf.setTie(rs.getDouble(23));
		perf.setWin(rs.getDouble(24));
		perf.setCleanSheets(rs.getDouble(25));
		perf.setOwnGoals(rs.getDouble(26));
		perf.setSetPieceGoals(rs.getDouble(27));
		perf.setSaves(rs.getDouble(28));
		perf.setCrosses(rs.getDouble(29));
		perf.setSalaryReal(rs.getDouble(30));
		perf.setOwnedStarmo(rs.getDouble(31));
		perf.setOwned(rs.getDouble(32));
		return perf;
	}
}
